﻿<%@ Page AutoEventWireup="true" CodeBehind="Admin_Article.aspx.cs" Inherits="V5_EShop.Admin.Article.Admin_Article"
    Language="C#" MasterPageFile="~/Includes/AdminMaster.Master" %>

<asp:Content ID="Content1" runat="server" ContentPlaceHolderID="title">
</asp:Content>
<asp:Content ID="Content2" runat="server" ContentPlaceHolderID="head">
</asp:Content>
<asp:Content ID="Content3" runat="server" ContentPlaceHolderID="content">
    <table border="0" cellpadding="0" cellspacing="0" class="tablelist">
        <tr>
            <td class="header">
                位置导航：<a class="list_link" href="<%=this.ResolveUrl("~/") %>Admin/Admin_Index_Main.aspx"
                    target="main">首页</a> >> 文章管理
            </td>
        </tr>
        <tr>
            <td>
                <a href="Admin_Article.aspx">管理文章</a> | <a href="Admin_Article.aspx?Action=edit">添加文章</a>
            </td>
        </tr>
    </table>
    <asp:MultiView ID="MultiViewList" runat="server">
        <asp:View ID="View1" runat="server">
            <table border="0" cellpadding="0" cellspacing="0" class="tablelist">
                <tr>
                    <td>
                        <asp:DropDownList ID="ddlAll" runat="server">
                            <asp:ListItem Value="0">请选择一个操作</asp:ListItem>
                            <asp:ListItem Value="1">批量删除</asp:ListItem>
                        </asp:DropDownList>
                        <asp:Button ID="btnAll" runat="server" Text="执行操作" EnableViewState="False" OnClick="btnAll_Click" />
                        分类:
                        <asp:DropDownList ID="ddlSearchClassId" runat="server">
                        </asp:DropDownList>
                        搜索：
                        <asp:TextBox ID="txtSearchText" runat="server"></asp:TextBox>
                        <asp:Button ID="btnSearch" runat="server" CausesValidation="False" Text="搜 索" OnClick="btnSearch_Click" />
                    </td>
                </tr>
            </table>
            <asp:GridView ID="gvList" runat="server" AutoGenerateColumns="False" CssClass="tablelist rowlist overlist tableheader"
                GridLines="None" OnRowCommand="gvList_RowCommand">
                <HeaderStyle CssClass="headertext" />
                <Columns>
                    <asp:TemplateField HeaderText="选择" HeaderStyle-CssClass="headertext">
                        <HeaderTemplate>
                            <input id="Checkbox1" onclick="selectedAll(this);" type="checkbox" />
                        </HeaderTemplate>
                        <ItemTemplate>
                            <asp:CheckBox ID="chkitem" runat="server" CssClass="checkitem" />
                            <asp:HiddenField ID="hfID" runat="server" Value='<%#Eval("ID") %>' />
                        </ItemTemplate>
                        <HeaderStyle CssClass="headertext" />
                        <ItemStyle Width="30px" HorizontalAlign="Center" />
                    </asp:TemplateField>
                    <asp:BoundField DataField="ID" HeaderText="ID">
                        <ItemStyle Width="30px" />
                    </asp:BoundField>
                    <asp:BoundField DataField="Title" HeaderText="标题" />
                    <asp:BoundField DataField="Editor" HeaderText="录入者/编辑者">
                        <ItemStyle Width="150px" />
                    </asp:BoundField>
                    <asp:BoundField DataField="Hits" HeaderText="点击">
                        <ItemStyle Width="40px" />
                    </asp:BoundField>
                    <asp:TemplateField HeaderText="审核">
                        <ItemTemplate>
                            <%# Eval("Passed").ToString()=="1"?"√":"×"%>
                        </ItemTemplate>
                        <ItemStyle Width="40px" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="操作">
                        <ItemTemplate>
                            <asp:LinkButton ID="LinkButton1" runat="server" CommandArgument='<%#Eval("ID") %>'
                                CommandName="go">修改</asp:LinkButton>
                            <asp:LinkButton ID="LinkButton2" runat="server" CommandArgument='<%#Eval("ID") %>'
                                CommandName="del" OnClientClick="return confirm('你确定要删除吗?')">删除</asp:LinkButton>
                        </ItemTemplate>
                        <ItemStyle Width="150px" />
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
            <table border="0" align="center" cellpadding="0" cellspacing="0" class="tablelist">
                <tr>
                    <td>
                        <webdiyer:AspNetPager ID="Pager" runat="server" CustomInfoHTML="共%PageCount%页，当前为第%CurrentPageIndex%页，每页%PageSize%条"
                            FirstPageText="首页" HorizontalAlign="Right" LastPageText="尾页" NextPageText="下一页"
                            OnPageChanged="Pager_PageChanged" PageIndexBoxType="DropDownList" PageSize="20"
                            PrevPageText="上一页" ShowCustomInfoSection="Left" ShowPageIndexBox="Always" SubmitButtonText="Go"
                            TextAfterPageIndexBox="页" TextBeforePageIndexBox="转到" AlwaysShow="True">
                        </webdiyer:AspNetPager>
                    </td>
                </tr>
            </table>
        </asp:View>
        <asp:View ID="View2" runat="server">
            <table border="0" cellpadding="0" cellspacing="0" class="tablelist">
                <tr>
                    <td colspan="4" class="headertext">
                        &nbsp;
                        <asp:Label ID="lblTitle" runat="server" Text="添加文章"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td width="15%">
                        标题：
                    </td>
                    <td colspan="3" style="height: 14px">
                        <asp:TextBox ID="txtTitle" runat="server" Width="363px"></asp:TextBox>
                        &nbsp;
                        <asp:CheckBox ID="chkPassed" runat="server" Text="立即发布" Checked="True" />
                    </td>
                </tr>
                <tr>
                    <td>
                        关键字：
                    </td>
                    <td colspan="3">
                        <asp:TextBox ID="txtKeys" runat="server" Width="361px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        选择栏目：
                    </td>
                    <td colspan="3">
                        <asp:DropDownList ID="ddlClassID" runat="server">
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td>
                        来源：
                    </td>
                    <td width="36%">
                        <asp:TextBox ID="txtCopyFrom" runat="server" Width="124px"></asp:TextBox>
                    </td>
                    <td width="11%">
                        作者：
                    </td>
                    <td width="33%">
                        <asp:TextBox ID="txtAuthor" runat="server" Width="124px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        转向链接：
                    </td>
                    <td colspan="3">
                        <asp:TextBox ID="txtLinkUrl" runat="server" Width="344px"></asp:TextBox>
                        <asp:CheckBox ID="chkLinkUrl" runat="server" Text="是" />
                    </td>
                </tr>
                <tr>
                    <td>
                        类型：
                    </td>
                    <td colspan="3">
                        <asp:CheckBox ID="chkIsOnTop" runat="server" Text="热门" />
                        <asp:CheckBox ID="chkRecommended" runat="server" Text="推荐" />
                    </td>
                </tr>
                <tr>
                    <td>
                        简介：
                    </td>
                    <td colspan="3">
                        <asp:TextBox ID="txtShortContent" runat="server" Height="101px" TextMode="MultiLine"
                            Width="546px"></asp:TextBox>不要超过200个字符
                    </td>
                </tr>
                <tr>
                    <td valign="top">
                        详细内容：
                    </td>
                    <td colspan="3" valign="top">
                        <asp:TextBox ID="txtContent" runat="server" TextMode="MultiLine"></asp:TextBox>
                        <script type="text/javascript">
        			        //<![CDATA[
                            CKEDITOR.replace('<%= this.txtContent.ClientID %>',
					        {
					            skin: 'v2',
					            height: 350,
					            resize_enabled: false
					        });
        			        //]]>
                        </script>
                    </td>
                </tr>
                <tr>
                    <td>
                        图片：
                    </td>
                    <td colspan="3">
                        <asp:TextBox ID="txtDefaultPicUrl" runat="server" Width="333px"></asp:TextBox>
                        <input id="Button1" onclick="OpenPictureDialog('txtDefaultPicUrl',620,450);" type="button"
                            value="上传文件" />
                    </td>
                </tr>
                <tr>
                    <td>
                        点击次数：
                    </td>
                    <td colspan="3">
                        <asp:TextBox ID="txtHits" runat="server">0</asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td align="center" colspan="4" style="height: 22px">
                        <asp:HiddenField ID="txtID" runat="server" Value="0" />
                        <asp:Button ID="btnSave" runat="server" OnClick="btnSave_Click" Text="确认保存" CssClass="ds-btn ds-btn-ok" />
                        <input id="Reset1" type="reset" value="重新设置" class="ds-btn" />
                    </td>
                </tr>
            </table>
            <script type="text/javascript">
             $(function() {
                    $("#<%=this.Form.ClientID %>").validate({
                        rules: {
                        <%=txtTitle.UniqueID %>: 
                        {
                            required: true
                        },
                        <%=ddlClassID.UniqueID %>: 
                        {
                            min: 1
                        }
                    },
                    messages:{
                        <%=txtTitle.UniqueID %>: 
                        {
                            required: "标题不能为空!"
                        },
                        <%=ddlClassID.UniqueID %>: 
                        {
                            min:  "请选择正确的分类!"
                        }
                    }
                });
            });
            </script>
        </asp:View>
    </asp:MultiView>
</asp:Content>
